import request from '@/utils/request'

// 分页
export function pagingWarehouse(query) {
  return request({
    url: '/warehouse/warehouseInfo/paging',
    method: 'get',
    params: query
  })
}

// 根据id获取仓库信息
export function getWarehouse(warehouseId) {
  return request({
    url: '/warehouse/warehouseInfo/get',
    method: 'get',
    params: {
      warehouseId
    }
  })
}

// 根据条件获取仓库列表
export function listWarehouseInfo(query) {
  return request({
    url: '/warehouse/warehouseInfo/listWarehouseInfo',
    method: 'get',
    params: query
  })
}

// 保存
export function saveWarehouse(data) {
  return request({
    url: '/warehouse/warehouseInfo/save',
    method: 'post',
    data: data
  })
}

// 更新授权类型
export function updateAuthorizeType(data) {
  return request({
    url: '/warehouse/warehouseInfo/updateAuthorizeType',
    method: 'post',
    data: data
  })
}

// 同步云仓
export function doSyncQimenWarehouse(data) {
  return request({
    url: '/warehouse/warehouseInfo/doSyncQimenWarehouse',
    method: 'post',
    data: data
  })
}

// 排序移动
export function doMoveUpdate(query) {
  return request({
    url: '/warehouse/warehouseInfo/doMove',
    method: 'get',
    params: query
  })
}

// 删除
export function deleteWarehouse(data) {
  return request({
    url: '/warehouse/warehouseInfo/delete',
    method: 'post',
    data: data
  })
}

// 仓库类型查询
export function listWarehouseType(params) {
  return request({
    url: '/warehouse/warehouseInfo/listWarehouseType',
    method: 'get',
    params
  })
}

export function pagingWarehouseSellList(query) {
  return request({
    url: '/warehouse/warehouseInfo/pagingWarehouseSellList',
    method: 'get',
    params: query
  })
}
/**
 * 获取团购仓库信息
 * @param {Object} params
 */
export function getGroupBuyWarehouseInfo(params) {
  return request({
    url: '/warehouse/warehouseInfo/getGroupBuyWarehouseInfo',
    method: 'get',
    params: params
  })
}
